package com.example.store.Error;

import com.example.store.entity.User;
import com.example.store.mapper.UserMapper;
import com.example.store.service.impl.UserServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;

@SpringBootTest
@RunWith(SpringRunner.class)
public class error {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private UserServiceImpl userService;


//    @Test
//    public void error(){
//        Integer uid =10;
//        String oldpassword = "123456";
//        String username = "超级改错员";
//        Date date = new Date();
//        User result = userMapper.findByUid(10);
//        String salt = result.getSalt();
//        String md5Password = userService.getMd5Password(salt, oldpassword);
//        Integer v = userMapper.updatePasswordByUid(10,md5Password,username,date);
//        if (!(v == 1)){
//            System.out.println("修改失败");
//        }
//        System.out.println("修改成功！");
//
//    }
}
